<?php
echo $this->Session->flash();

echo "<h1>PLANO TOPOGRAFICO DEL PREDIO " . $this->Session->read('predio_codigo') . "</h1>";
?>

<?php echo $form->create('TopographicMap'); ?>

<?php echo $form->hidden("TopographicMap.property_id", array('value' => $property_id)); ?>

<table border="1" id="tabla"  width="100%">
    <thead>
        <tr>
            <th></th>
            <th>Dato Revisión</th>
            <th>Dato plano</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td colspan="2">ENTIDAD QUE ELABORÓ EL PLANO</td>

            <td>

                <?php echo $form->input("TopographicMap.entidad", array('label' => '', 'empty' => 'Seleccione entidad', 'options' => array('IGAC' => 'IGAC', 'INCODER' => 'INCODER'))); ?>

            </td>
        </tr>
        <tr>
            <td>Departamento</td>
            <td><?php echo $revision['Departament']['name'] ?></td>
            <td>
                <?php
                echo $form->input('TopographicMap.departament_id', array(
                    'label' => __('Departamento', true),
                    'empty' => __('Seleccione Departamento', true),
                ));
                ?>
                <?php
                echo $ajax->observeField('TopographicMapDepartamentId', array(
                    'url' => array('action' => 'select'),
                    'frequency' => 0.2,
                    'update' => 'ciudades',
                    'indicator' => 'loading1'
                        )
                );
                ?>
            </td>
        </tr>
        <tr>
            <td>Municipio</td>
            <td><?php echo $revision['City']['name'] ?></td>
            <td>
                <div id="ciudades">
                    <?php echo $form->input("TopographicMap.city_id", array('label' => 'Municipio', 'type' => 'select', 'empty' => 'Seleccione Ciudad')); ?>
                </div>
            </td>
        </tr>
        <tr>
            <td>Vereda</td>
            <td><?php echo $revision['Property']['vereda'] ?></td>
            <td><?php echo $form->input("TopographicMap.vereda", array('label' => 'Vereda')); ?></td>
        </tr>

        <tr>
            <td>Nombre del predio</td>
            <td><?php echo $revision['Property']['nombre'] ?></td>
            <td><?php echo $form->input("TopographicMap.nombre_predio", array('label' => '')); ?></td>
        </tr>
        <tr>
            <td>Matricula</td>
            <td><?php echo $revision['Property']['matricula'] ?></td>
            <td><?php echo $form->input("TopographicMap.matricula", array('label' => '')); ?></td>
        </tr>
        <tr>
            <td>Número catastral</td>
            <td><?php echo $revision['Property']['nro_catastral'] ?></td>
            <td><?php echo $form->input("TopographicMap.numero_catastral", array('label' => '')); ?></td>
        </tr>
        <tr>
            <td>Área plano (ha)</td>
            <td><?php echo $form->input("TopographicMap.area", array('label' => '')); ?></td>
            <td></td>
        </tr>
        <tr>
            <td>¿Es venta parcial?</td>
            <td><?php echo $form->input("TopographicMap.venta_parcial", array('label' => '' ,'options'=>array('empty'=>'', 'Si'=>'Si','No'=>'No'))); ?></td>
            <td></td>
        </tr>
        <tr>
            <td>Calificación</td>
            <td><?php echo $form->input("TopographicMap.calificacion", array('label' => '', 'options' => array('0' => 'Sin registro', '1' => 'Cumple', '2' => 'Subsanable'))); ?></td>
            <td></td>
        </tr>
        <tr>
            <td>Observación</td>
            <td><?php echo $form->input("TopographicMap.observacion", array('label' => '')); ?></td>
            <td></td>
        </tr>
    </tbody>
</table>

<?php
if ($this->Session->read('estado') == 0)
    echo $ajax->submit('Guardar', array('url' => array('controller' => 'TopographicMaps', 'action' => 'add', $property_id), 'update' => 'content', 'indicator' => 'loading'));
?>
<?php echo $form->end(); ?>


<table width="100%" border="0"  CellSpacing=10  align="center" >
    <tbody>
        <tr>
            <td><?php echo $ajax->link($html->image('regresar.gif', array('width' => '30', 'heigth' => '30', 'alt' => 'Regresar', 'title' => 'regresar')), array('controller' => 'TopographicMaps', 'action' => 'index', $property_id), array('update' => 'content', 'complete' => 'cargar()', 'indicator' => 'loading', 'escape' => false)); ?></td>
        </tr>
    </tbody>
</table>
